![]() |
CTab2Palette |
||||
Header: | Palettes.h | Carbon status: | Supported | |
Copies the colors of a color table into a palette.
void CTab2Palette ( CTabHandle srcCTab, PaletteHandle dstPalette, SInt16 srcUsage, SInt16 srcTolerance );
A handle to the color table whose colors are to be copied.
The palette to receive the colors.
A usage constant to be assigned the palette entries. Usage constants are described in
A tolerance value to be assigned the palette entries.
The CTab2Palette function copies the fields from an existing color-table structure into an existing palette structure. If the structures are not the same size, then CTab2Palette resizes the palette structure to match the number of entries in the color-table structure. If the palette in dstPalette has any entries allocated for animation on any screen device, they are relinquished before the new colors are copied. The srcUsage and srcTolerance parameters are the value that you assign to the new colors.
If you want to use color-table animation, you can use AnimateEntry and AnimatePalette to change the colors in a palette and on corresponding devices. Changes made to a palette by CTab2Palette do not take effect until the next ActivatePalette function is performed. If either the color-table handle or the palette handle is NULL, CTab2Palette does nothing.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)